package com.generator.code.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.generator.code.model.GenColumnEntity;
import com.generator.code.model.GenTableEntity;
import com.generator.code.model.QryTableInfo;
import com.generator.code.model.QryTableInfoReq;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author guoq.z
 * @date 2021/4/1
 */
@Mapper
@Component
public interface MysqlMapper {

    Page<QryTableInfo> qryTableInfo(Page<QryTableInfo> page,
                                     @Param("qryTableInfoReq") QryTableInfoReq qryTableInfoReq);

    List<String> queryAllTableName();

    /**
     * 查询表信息
     *
     * @param tableName 表名称
     * @return TableModel
     */
    GenTableEntity queryTableInfo(@Param("tableName") String tableName);

    /**
     * 查询表的列信息
     *
     * @param tableName 表名称
     * @return ColumnsModel list
     */
    List<GenColumnEntity> queryColumns(@Param("tableName") String tableName);
}
